package site.jlopen.secret.uitl;

import java.io.FileOutputStream;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;

public class ReadCertFile {

	public static void main(String[] args) {
		try {
			/*FileInputStream fis = new FileInputStream("F:\\eclipse2019_workspaces_work3\\secretpad-main\\secretpad-web\\config\\certs\\client.crt");
			CertificateFactory cf = CertificateFactory.getInstance("X.509");
			X509Certificate cert = (X509Certificate) cf.generateCertificate(fis);
			byte[] bs = cert.getEncoded();
			fis.close();*/
			
			byte[] bFile = Files.readAllBytes(Paths.get("F:\\eclipse2019_workspaces_work3\\secretpad-main\\secretpad-web\\config\\certs\\client.crt"));
			
			FileOutputStream fos = new FileOutputStream("F:\\eclipse2019_workspaces_work3\\secretpad-main\\secretpad-web\\config\\certs\\client_rep.crt");
			fos.write(bFile,0,bFile.length);
			fos.flush();
			fos.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static byte[] io2Byte(InputStream io) {
		
		return null;
	}

	public static String byte2String(byte[] bs) {
		return null;
	}
}
